init();
new Vue({
	el: "body",
	data: {
		uncurrent: false,
		shop:[],
		loading: true,
	},
	methods: {
		reshop:function(shopid){
			location.href="../shopmain/shopmain.html?shopid="+shopid;
		},
		login:function(){
			location.href="../loginAndReg/login.html";
		}
	},
	created: function() {
		var currentUser = AV.User.current();
		var shop=this.shop;
		if(currentUser) {
			var username = currentUser.attributes.username;
			var query = new AV.Query('ELM_order'); //订单表
			var tar=query.contains("username",username);
			tar.find().then(function(item) {
				console.log(item);
				for(var i=0;i<item.length;i++){
					shop.unshift(item[i]);
				}
			});
		} else {
			this.uncurrent = true;
		}
	},
	beforeCompile: function() {
		this.loading = true;
	}
})